package com.example.crm.web.controller;

import com.example.crm.model.CourseOrder;
import com.example.crm.model.PageResult;
import com.example.crm.service.interfase.ICourseOrderService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("course")
public class CourseOrderController {
    @Autowired
    ICourseOrderService courseOrderService;
//    @Autowired
//    private Environment env;获取配置文件对象
//    @Value("${spring.datasource.url}")
//    private String url;获取配置文件的信息
    @RequestMapping("list")
    public String index(){
//    System.out.println(env.getProperty("server.port"));
//    System.out.println(url);
        return "courseorder/list.html";
    }
    @RequestMapping("jsonlist")
    @ResponseBody
    public PageResult<CourseOrder>listJson(int page,int limit){
        PageResult<CourseOrder>result = courseOrderService.findPageResult(null,page,limit);
    return result;
    }

}
